package com.jzr.medical.controller.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jzr.common.entity.vo.Result;
import com.jzr.common.entity.vo.ResultPage;
import com.jzr.medical.db1.dto.WorkPlanDto;
import com.jzr.medical.db1.service.WorkPlanService;
import com.jzr.medical.db1.vo.WorkPlanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/workPlan")
public class WorkPlanController {
    @Autowired
    private WorkPlanService workPlanService;

    @PostMapping("/list")
    public ResultPage<WorkPlanVo> list(@RequestBody WorkPlanDto record){
        IPage<WorkPlanVo> page = workPlanService.page(record);
        return ResultPage.success(page);
    }
    @PostMapping("/saveBatch")
    public Result<List<WorkPlanVo>> saveBatch(@RequestBody List<WorkPlanVo> list){
        List<WorkPlanVo>  result = workPlanService.saveBatch(list);
        return Result.success("成功",result);
    }

}
